{% extends "widgets/widget.html" %}

{% load i18n %}

{% block widget-content %}
{% regroup object_list by start as events_by_date %}
{% if events_by_date %}
<dl class="events">
    {% for date in events_by_date %}
    <dt><h5>{{ date.grouper.date }}</h5></dt>
    <dd>
        <ul>
        {% for item in date.list %}
            <li{% if item.closed %}{% if item.expired %} class="delayed"{% else %} class="closed"{% endif %}{% else %}{% if item.expired %} class="expired"{% endif %}{% endif %}>
                <strong>{{ item.start.time }}</strong>
                <a href="{{ item.get_absolute_url }}">{{ item.title }}</a>
            </li>
        {% endfor %}
        </ul>
    </dd>
    {% endfor %}
</dl>
{% else %}
{% include "elements/empty.html" %}
{% endif %}
<p class="add"><a title="{% trans 'Add' %}" href="{% url event_add %}">{% trans "Add" %}</a></p>
<p><a title="{% trans 'See all' %}" href="{% url event_list %}">{% trans "See all" %}</a></p>
{% endblock %}
